import request from '@/utils/request'

// 获取审批详情
export function getApprovalDetail(data) {
  return request({
    url: '/bpm/process-instance/get-approval-detail',
    method: 'get',
	data
  })
}

// 审批通过
export function approveTask(data) {
  return request({
    url: '/bpm/task/approve',
    method: 'put',
	data
  })
}

// 文件传阅专用
export function approveTaskCirculation(data) {
  return request({
    url: '/bpm/oa-document-circulation/approve',
    method: 'post',
	data
  })
}

// 文号申请专用
export function oaApplicationNumberApprove(data) {
  return request({
    url: '/bpm/oa-application-number/approve',
    method: 'post',
	data
  })
}
// export const approveTaskCirculation = async (data: any) => {
//   return await request.post({ url: '/bpm/oa-document-circulation/approve', data })
// }


// 审批拒绝
export function rejectTask(data) {
  return request({
    url: '/bpm/task/reject',
    method: 'put',
	data
  })
}

// 获取当前审批步骤
export function getTaskListByProcessInstanceId(processInstanceId) {
  return request({
    url: '/bpm/task/list-by-process-instance-id?processInstanceId='+processInstanceId,
    method: 'get',
  })
}

// 审批抄送
export function copyTask(data) {
  return request({
    url: '/bpm/task/copy',
    method: 'put',
	data
  })
}

// 审批转派
export function transferTask(data) {
  return request({
    url: '/bpm/task/transfer',
    method: 'put',
	data
  })
}

// 审批委派
export function delegateTask(data) {
  return request({
    url: '/bpm/task/delegate',
    method: 'put',
	data
  })
}

// 审批加签
export function signCreateTask(data) {
  return request({
    url: '/bpm/task/create-sign',
    method: 'put',
	data
  })
}

// 获取所有可退回的节点
export function getTaskListByReturn(data) {
  return request({
    url: '/bpm/task/list-by-return',
    method: 'get',
	data
  })
}

// 审批退回
export function returnTask(data) {
  return request({
    url: '/bpm/task/return',
    method: 'put',
	data
  })
}

